<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'mortgage.label', default: 'Mortgage')}"/>
    <title>催收台账</title>
    <style>
    .table>tbody>tr>td{
        vertical-align: middle;
    }
    @media screen and (min-width:1900px) and (max-width:1920px) {
        .flex{
            display: flex;justify-content: center;align-items: center;
        }
    }
    .select2-container .select2-choices .select2-search-field input,.select2-container .select2-choice,.select2-container .select2-choices{

        color: #999;
    }
    </style>
</head>

<body class="fixed-navbar fixed-sidebar">

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right navFloatRight">
                <ol class="hbreadcrumb breadcrumb">
                    <li>
                        <span>CINDATA PLS</span>
                    </li>
                    <li class="active">
                        <span>催收台账</span>
                    </li>
                </ol>
            </div>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" action="collectionIndex" class="form-horizontal" role="form" id="form" onsubmit="return text1();">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    <div class="panel-tools">
                        <button class="btn btn-primary btn-xs" type="submit" onclick=""><i class="fa fa-search"></i> 查询</button>
                        <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                            <i class="fa fa-times"></i> 重置</button>
                    </div>
                    查询
                </div>
                <div class="panel-body seach-group" id="bug1">
                    %{--第一行--}%
                    <div class="row">
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">借款人姓名</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="borrName" id="borrName" value="${params?.borrName}" placeholder="请输入借款人姓名">
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">手机号</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="borrPhone" id="borrPhone" value="${params?.borrPhone}" placeholder="请输入手机号">
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">逾期期数</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="curOverdueDuration" id="curOverdueDuration" value="${params?.curOverdueDuration}" placeholder="请输入逾期期数">
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">逾期天数</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="fullName" id="fullName" value="${params?.fullName}" placeholder="请输入逾期天数">
                            </div>
                        </div>

                    </div>
                    %{--第二行--}%
                    <div class="row">
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">催收措施</label>
                            <div class="col-sm-9 input-group" style="display: flex;justify-content: center">
                                <g:select class="form-control" name="identityType" id="identityType"
                                          optionKey="id" optionValue="name"
                                          from="${com.cindata.dictionary.ContactIdentityType.list()}"
                                          value="${params?.identityType}"
                                          noSelection="${['': '请选择']}"/>
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">催收次数</label>
                            <div class="col-sm-9">
                                <input type="text" class="form-control" name="fullName" id="collectionCount" value="${params?.collectionCount}" placeholder="请输入催收次数">
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">作业部门</label>
                            <div class="col-sm-9 input-group" style="display: flex;justify-content: center">
                                <g:select class="form-control" name="identityType" id="identityType"
                                          from="${['内催部','外委部']}"
                                          value="${params?.identityType}"
                                          noSelection="${['': '请选择']}"/>
                            </div>
                        </div>
                        <div class="form-group col-sm-3">
                            <label class="col-sm-3 control-label">催收状态</label>
                            <div class="col-sm-9 input-group" style="display: flex;justify-content: center">
                                <g:select class="form-control" name="identityType" id="identityType"
                                          from="${['已催收','已安排','待安排']}"
                                          value="${params?.identityType}"
                                          noSelection="${['': '请选择']}"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </g:form>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <!-- <button class="btn btn-warning2 btn-xs" type="submit" onclick="searchMap()"><i class="fa fa-map-marker"></i> 查看地图</button> -->
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                &nbsp;&nbsp;
            </div>

            <div class="panel-body no-padding">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class="table table-striped table-bordered table-hover text-center" id="esateTable">
                        <thead>
                        <tr>
                            <g:sortableColumn property="serialNumber" title="序号" class="" params="${params}"/>
                            <g:sortableColumn property="borrName" title="借款人" class="" params="${params}"/>
                            <g:sortableColumn property="serialNumber" title="贷款编号" class="" params="${params}"/>
                            <g:sortableColumn property="borrPhone" title="手机号" class="" params="${params}"/>
                            <g:sortableColumn property="borrAddress" title="地址" class="" params="${params}"/>
                            <g:sortableColumn property="loansBalance" title="贷款余额" class="" params="${params}"/>
                            <g:sortableColumn property="loansAmount" title="贷款总额" class="" params="${params}"/>
                            <g:sortableColumn property="loansAmount" title="还款方式" class="" params="${params}"/>
                            <g:sortableColumn property="loansAmount" title="月还款金额" class="" params="${params}"/>
                            <g:sortableColumn property="mortgageStatus" title="贷款状态" class="" params="${params}"/>
                            <g:sortableColumn property="curOverdueDuration" title="逾期期数" class=" " params="${params}"/>
                            <g:sortableColumn property="curOverdueDuration" title="逾期天数" class=" " params="${params}"/>
                            <g:sortableColumn property="curOverdueDuration" title="催收次数" class=" " params="${params}"/>
                            <g:sortableColumn property="curOverdueDuration" title="催收措施" class=" " params="${params}"/>
                            <g:sortableColumn property="curOverdueDuration" title="最近催收时间" class=" " params="${params}"/>
                            <g:sortableColumn property="loansAmount" title="作业部门"  class="" params="${params}"/>
                            <g:sortableColumn property="loansBalance" title="催收状态" class=""  params="${params}"/>
                            <th class="col-md-1 text-center" style="color: #34495e;">操作项</th>
                        </tr>
                        </thead>
                        <tbody>
                        %{--<g:each in="${riskWarningList}">--}%
                            <tr>
                                <td><g:link style="color: #3498DB" class="firstTd" id="${it?.id}" action="show">${it?.mortgage?.serialNumber}</g:link></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td></td>
                                <td class="text-center">
                                    <div style="margin-bottom: 2px;">
                                        <g:link action="collectionPlan" id="${it?.mortgage?.id}" class="btn btn-xs btn-outline btn-success handleButton">
                                            催收安排
                                        </g:link>
                                    </div>
                                </td>
                            </tr>
                        %{--</g:each>--}%
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate action="collectionIndex" total="${riskWarningcount ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>
</div>

<g:javascript>
    $(function () {
        $('#datepicker').datepicker({
            language: 'zh-CN'
        });
        $("#datepicker").on("changeDate", function(event) {
            $("#my_hidden_input").val(
                    $("#datepicker").datepicker('getFormattedDate')
            )
        });

        $('.input-group.date').datepicker({ });
        $('.input-daterange').datepicker({ });
    });

    //重置按钮
    $("#resetBtn").click(function () {
        $("#communityId").val("");
        $("#s2id_city span:first").html("请选择城市");
        $("#city").val("");
        $("#s2id_loansDuration span:first").html("请选择贷款时长");
        $("#loansDuration").val("");
        $("#loansAmountStart").val("");
        $("#loansAmountEnd").val("");
        $("#loansBalanceStart").val("");
        $("#loansBalanceEnd").val("");
        $("#s2id_mortgageStatus span:first").html("请选择贷款状态");
        $("#mortgageStatus").val("");
        $("#s2id_isNonPerformingLoan span:first").html("请选择是否不良");
        $("#isNonPerformingLoan").val("");
        $("#startDateEnd").val("");
        $("#startDateStart").val("");
        $('#s2id_accountId span:first').html('请选择受理网点名称');
        $('#accountId').val("");
        $('#s2id_mortgageType span:first').html('请选择抵押类型');
        $('#mortgageType').val("");
        $('#s2id_mortgagePattern span:first').html('请选择贷款方式');
        $('#mortgagePattern').val("");
        $('#s2id_mortgageCategory span:first').html('请选择贷款类型');
        $('#mortgageCategory').val("");
    });

</g:javascript>

</body>
</html>
